/*
 * @des: 入口
 * @author: yyq
 * @Date: 201-01-05
*/


import Vue from 'vue'
import Router from 'vue-router'
import routes from './router'
import store from './store/'
import App from './App'
import ElementUI from 'element-ui'
import './config/common'					// 引入定义的全局变量
// import 'element-ui/lib/theme-chalk/index.css'
import '../theme/index.css'					// 引入自定义修改的element样式
import './assets/css/reset.less'			// 重置样式
import './assets/css/iconfont/iconfont.css'	// 引入字体图标

Vue.config.productionTip = false


Vue.use(ElementUI)
Vue.use(Router)
global.router = new Router({
	routes,
	mode: 'history',
	strict: process.env.NODE_ENV !== 'production',
	scrollBehavior (to, from, savedPosition) {
	    if (savedPosition) {
		    return savedPosition
		} else {
			if (from.meta.keepAlive) {
				from.meta.savedPosition = document.body.scrollTop;
			}
		    return { x: 0, y: to.meta.savedPosition || 0 }
		}
	}
})


new Vue({
	el: '#app',
	router,
	store,
	template: '<App/>',
	components: { App }
})
